﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CaiyinSoft.NetGather.Protocol
{
    /// <summary>
    /// 转换一个网页到XML文件
    /// </summary>
    public interface IHTMLAnalyzer  
    {
        Dictionary<int, int> HTMLLineInfo { get; }
        /// <summary>
        /// 获取或设置抓取的是不是列表数据
        /// </summary>
        //bool ListResult { get; set; }
        /// <summary>
        /// 当前HTML的页数
        /// </summary>
        int PageIndex { get; set; }
        /// <summary>
        /// 待转换的HTML
        /// </summary>
        void SetInputHTML(string html);
        string GetInputHTML();
        /// <summary>
        /// 转换完成后，保存的完整文件名
        /// </summary>
        //string TargetFile { get; set; }

        /// <summary>
        /// 过滤器列表
        /// </summary>
        List<IHTMLFilter> HTMLFilters { get; set; }
        /// <summary>
        /// 分页过滤器
        /// </summary>
        IHTMLFilter NextHTMLFilter { get; set; }

        /// <summary>
        /// 增加过滤器
        /// </summary>
        /// <param name="htmlFilter"></param>
        void AddFilter(IHTMLFilter htmlFilter);
        List<IHTMLFilter> Convert();
        /// <summary>
        /// 获取下一页Url
        /// </summary>
        /// <returns></returns>
        string NextPageUrl();
        void SetInputHTMLUrl(string url);
        string GetInputHTMLUrl();
        //void InitFromConfigFile(string fileName);

        //int GetPosition(int line, int position);
        IHTMLAnalyzer Clone();

        InnerFormBase GetEditForm();
    }
}
